﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;

using SmartSiteManagementSystem.Models.Material;

namespace SmartSiteManagementSystem.IRepository.Material
{
    public interface IMaterialCatalogInfoRepository
    {
        /// <summary>
        /// 取得记录数
        /// </summary>
        /// <param name="param">可选参数为：</param>
        /// <returns></returns>
        int GetCount(Hashtable param);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        IList<MaterialCatalogInfo> GetList(Hashtable param);


        /// <summary>
        /// 提取数据
        /// </summary>
        /// <param name="param">可选参数为：</param>
        /// <param name="orderBy">排序方式:默认为“GroupID asc”</param>
        /// <param name="first">起始记录：从0开始</param>
        /// <param name="rows">提取的条数</param>
        /// <returns></returns>
        IList<MaterialCatalogInfo> GetList(Hashtable param, string orderBy, int first, int rows);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        IList<MaterialCatalogInfo> GetParents(Hashtable param);

        /// <summary>
        /// 提取数据
        /// </summary>
        /// <param name="groupID"></param>
        /// <returns></returns>
        MaterialCatalogInfo Get(Hashtable param);

        /// <summary>
        /// 插入数据
        /// </summary>
        /// <param name="obj">对象</param>
        /// <returns>返回：该条数据的主键Id</returns>
        int Insert(MaterialCatalogInfo obj);

        /// <summary>
        /// 更新数据
        /// </summary>
        /// <param name="obj"></param>
        /// <returns>返回：ture 成功，false 失败</returns>
        bool Update(MaterialCatalogInfo obj);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        bool Update(Hashtable param);

        /// <summary>
        /// 删除数据
        /// </summary>
        /// <param name="groupID"></param>
        /// <returns>返回：ture 成功，false 失败</returns>
        bool Delete(Hashtable param);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="catalogId"></param>
        /// <param name="parentId"></param>
        /// <returns></returns>
        bool Delete(int catalogId, int parentId);

    }
}
